// This MFC Samples source code demonstrates using MFC Microsoft Office Fluent User Interface 
// (the "Fluent UI") and is provided only as referential material to supplement the 
// Microsoft Foundation Classes Reference and related electronic documentation 
// included with the MFC C++ library software.  
// License terms to copy, use or distribute the Fluent UI are available separately.  
// To learn more about our Fluent UI licensing program, please visit 
// http://msdn.microsoft.com/officeui.
//
// Copyright (C) Microsoft Corporation
// All rights reserved.

// SketchDoc.h : interface of the CSketchDoc class
//


#pragma once
#include <vector>
#include "TxnMemory.h"
#include "Geom/Geometry2D.h"

class TxnMgr;
class CSketchSrvrItem;
typedef std::vector<Geometry2D*, txn_allocator<Geometry2D*> > TxnVector;

class CSketchDoc : public COleServerDocEx
{
protected: // create from serialization only
	CSketchDoc();
	DECLARE_DYNCREATE(CSketchDoc)

// Attributes
public:
	CSketchSrvrItem* GetEmbeddedItem()
		{ return reinterpret_cast<CSketchSrvrItem*>(COleServerDocEx::GetEmbeddedItem()); }

// Operations
public:

// Overrides
protected:
	virtual COleServerItem* OnGetEmbeddedItem();
public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);

// Implementation
public:
	virtual ~CSketchDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()

public:
	const TxnVector& GetAllGeometries(){return m_vecGeometries;}

	TxnMgr* GetTxnMgr() const {return m_pTxnMgr;}

	void AddGeometry(Geometry2D* pObj);

private:
	TxnVector& m_vecGeometries;
	TxnMgr* m_pTxnMgr;
};


